const loginData = {
  username: 'admin',
  avatar: '/avatar.jpg',
  id: 'dd55bda7-df0d-4b77-99b2-7056717c6923',
  password: 'admin'
};

const loginFunc = (ops) => {
  const obj = JSON.parse(ops.body);
  if (obj.username === loginData.username && obj.password === loginData.password) {
    let newObj = {...loginData};
    delete newObj.password;
    return newObj;
  }
};

module.exports = {
  path: '/api/login',
  type: 'post',
  func: loginFunc
}